import request from '../../utils/request2'

function queryCompany(data, queryType) {
    let res = {}
    res[queryType] = data[queryType]
    return request({
        url: '/company/page',
        method: 'post',
        data: {
            parameters: res, page: {
                pageSize: data.pageSize,
                pageIndex: data.pageIndex
            }
        }
    })
}
function addCompany(data) {
    return request({
        url: '/company/add',
        method: 'post',
        data: { parameters: data }
    })
}
function setCompany(data) {
    return request({
        url: '/company/modify',
        method: 'post',
        data: { parameters: data }
    })
}
function delCompany(data) {
    return request({
        url: '/company/delete',
        method: 'post',
        data: { parameters: data }
    })
}
function searchCompany(data) {
    return request({
        url: '/company/getlistByCompanyName',
        method: 'post',
        data: { parameters: data }
    })
}

export {
    queryCompany,
    addCompany,
    setCompany,
    delCompany,
    searchCompany
}